package com.he.domain.dto;

import com.he.annotation.LinkType;
import com.he.validator.LinkProvider;
import com.he.validator.groups.FriendLink;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.group.GroupSequenceProvider;

import jakarta.validation.constraints.NotNull;


/**
 * @author He
 * @version 1.0
 * @Date 2023/10/21 20:11
 * @Desc 链接DTO
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@GroupSequenceProvider(LinkProvider.class)
@Schema(description = "链接DTO")
public class LinkDTO {

    /**
     * 链接id
     */
    @Schema(description = "链接id")
    private Integer id;

    /**
     * 链接颜色
     */
    @NotBlank(message = "友链颜色不能为空",groups = {FriendLink.class})
    @Schema(description = "链接颜色")
    private String color;

    /**
     * 链接类型
     */
    @LinkType(values = {0, 1, 2}, message = "链接类型类型只能为0、1、2")
    @NotNull(message = "链接类型不能为空")
    @Schema(description = "链接类型")
    private Integer type;

    /**
     * 链接名称
     */
    @NotBlank(message = "链接名不能为空")
    @Schema(description = "链接名称")
    private String name;

    /**
     * 链接头像
     */
    @NotBlank(message = "友链头像不能为空",groups = {FriendLink.class})
    @Schema(description = "链接头像")
    private String avatar;

    /**
     * 链接地址
     */
    @NotBlank(message = "链接地址不能为空")
    @Schema(description = "链接地址")
    private String url;

    /**
     * 链接介绍
     */
    @NotBlank(message = "友链介绍不能为空",groups = {FriendLink.class})
    @Schema(description = "链接介绍")
    private String introduction;

}
